package com.example.shuiyin.dto;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

@Data
public class WatermarkAddRequest {
    
    @NotBlank(message = "图片ID不能为空")
    private String imageId;
    
    @NotBlank(message = "水印类型不能为空")
    @Pattern(regexp = "^(text|image)$", message = "水印类型只能是text或image")
    private String watermarkType; // text/image
    
    @Size(max = 100, message = "文本内容最多100个字符")
    private String content; // 文本内容或图片URL
    
    @Size(max = 100, message = "水印文本最多100个字符")
    private String text; // 水印文本
    
    @NotNull(message = "水印位置X坐标不能为空")
    @Min(value = 0, message = "X坐标不能小于0")
    private Integer positionX;
    
    @NotNull(message = "水印位置Y坐标不能为空")
    @Min(value = 0, message = "Y坐标不能小于0")
    private Integer positionY;
    
    @Min(value = 0, message = "透明度最小值为0")
    @Max(value = 100, message = "透明度最大值为100")
    private Integer opacity = 100;
    
    @Min(value = 0, message = "旋转角度最小值为0")
    @Max(value = 360, message = "旋转角度最大值为360")
    private Integer rotation = 0;
    
    @Min(value = 8, message = "字体大小最小值为8")
    @Max(value = 72, message = "字体大小最大值为72")
    private Integer fontSize;
    
    @Size(max = 50, message = "字体名称最多50个字符")
    private String fontFamily;
    
    @Pattern(regexp = "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$", message = "字体颜色必须是有效的十六进制颜色值")
    private String fontColor;
} 